﻿@{
    Layout = null;
    var parentColumnList = Model?.Where(d => d.ParentId == 0).ToList();
}
@model List<CmsColumnVM>
<header id="header">
    <div class="navbox">
        <h2 id="mnavh"><span class="navicon"></span></h2>
        <div class="logo"><a href="/" title="一起牛">一起牛</a></div>
        <nav>
            <ul id="starlist">
                <li><a href="/" title="首页">网站首页</a></li>
                @foreach (var parent in parentColumnList)
                {
                    var model = Model.Where(d => d.ParentId == parent.Id).FirstOrDefault();
                    if (model != null)
                    {
                        <li class="menu">
                            <a href="@domainConfig.CurrentValue.Host@Url.Action("NewsList", "Home", new { parentColumnUrl = parent.EnTitle })" title="@parent.Title">@parent.Title</a>
                            <ul class="sub">
                                @foreach (var item in Model)
                                {
                                    @if (parent.Id == item.ParentId)
                                    {
                                        <li><a href="@domainConfig.CurrentValue.Host@Url.Action("NewsList", "Home", new { parentColumnUrl = parent.EnTitle, childColumnUrl = item.EnTitle })/">@item.Title</a></li>
                                    }
                                }
                            </ul>
                            <span></span>
                        </li>
                    }
                    else
                    {
                        <li>  <a href="@domainConfig.CurrentValue.Host@Url.Action("NewsList", "Home", new { parentColumnUrl = parent.EnTitle })/" title="@parent.Title">@parent.Title</a></li>
                    }
                }
                <li><a href="@domainConfig.CurrentValue.Host@Url.Action("Link","Home")">博客推荐</a></li>
                <li><a href="@domainConfig.CurrentValue.Host@Url.Action("About","Home")">关于我们</a></li>
            </ul>
        </nav>
        <div class="searchico"></div>
    </div>
</header>
